package iha.standard;

import iha.framework.*;
import java.util.*;

import org.junit.*;
import static org.junit.Assert.*;

public class ItemCacheMock2 implements IItemCache
{
    private boolean success = true;
    private boolean c_lookup = false;
    private boolean c_add = false;

    public LinkedList<IItem> LookUpItem(final long partnumber, final String description)
    {
	if (c_lookup)
	    success = false;
	    
	c_lookup = true;

	return new LinkedList<IItem>();
    }

    public void AddItems(LinkedList<IItem> items)
    {
	if ( (!c_lookup) || c_add)
	     success = false;

	c_add = true;
    }

    public void RemoveItems(LinkedList<IItem> items){}

    public boolean success()
    {
	if (!success)
	    return false;
	else
	    return (c_lookup && c_add);
    }
}
